#include<bits/stdc++.h>
using namespace std;
typedef long long LL;

int n,k;
LL h[100001],hm=0;
LL sum=0;
int main(){
	scanf("%d%d",&n,&k);
	for(int i=0;i<n;i++){
		scanf("%d",&h[i]);
		sum+=h[i];
		hm=max(h[i],hm);
	}
	if(sum<k){
		printf("0");
		return 0;
	}
	LL cur;
	int l=1,r=hm,mid;
	while(l<r){
		mid=(r-l)/2+l;
		cur=0;
		for(int i=0;i<n&&cur<k;i++){
			cur+=h[i]/mid;
		}
		if(cur>=k){
			l=mid;
			if(r-l==1){
				cur=0;
				for(int i=0;i<n&&cur<k;i++){
					cur+=h[i]/(mid+1);
				}
				if(cur>=k) l=r;
				else r=l;
			};
		}
		else{
			r=mid-1;
		}
	}
	printf("%d",l);
	return 0;
}
